import json

filename = "favorite_num.json"

try:
    with open(filename) as f:
       num = json.load(f)
except FileNotFoundError:
    pass
else:
    print(f"最喜欢的数:{num}")